package com.example.lawyer.databind.itemview;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.view.View;
import android.widget.ImageView;

import androidx.annotation.RequiresApi;
import androidx.databinding.BindingAdapter;
import androidx.databinding.ObservableField;

import com.bumptech.glide.Glide;

public class ItemBiaoQingData {



    public ObservableField<Integer> rid = new ObservableField<>();

    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
    @BindingAdapter("setimg")
    public static void SetImg(View view,int img)
    {

        Context context = view.getContext();
        Drawable drawable = context.getDrawable(img);
        Glide.with(view).load(drawable).into((ImageView) view);
    }
}
